/**
 * 
 */
package de.midnightdance.server.service;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import de.midnightdance.model.character.Bund;
import de.midnightdance.model.character.Clan;
import de.midnightdance.model.character.JagdTechnik;
import de.midnightdance.model.character.Ritual;
import de.midnightdance.model.character.disziplin.DisziplinDB;
import de.midnightdance.model.character.vorteil.VorteilDB;
import de.midnightdance.model.user.RequiemUser;
import de.midnightdance.server.model.RequiemModel;

/**
 * @author Surfer
 *
 */

@WebService(name = "WebServiceAdminRequiem", serviceName = "ServiceAdminRequiem")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ServiceAdminRequiem {
	

//	===================================  User verwaltung ==========================================
	@WebMethod
	public RequiemUser[] getAllUsers(RequiemUser user){
		return RequiemModel.getInstance().getAllUsers(user);
	}	
	@WebMethod
	public RequiemUser isAuthenticUser(RequiemUser user){
		return RequiemModel.getInstance().isAuthenticUser(user);
	}	
	@WebMethod
	public int addUser(RequiemUser user,RequiemUser authorizingUser)  
	{
		return RequiemModel.getInstance().addUser(user, authorizingUser);		
	}	
	
	@WebMethod
	public int changeUser(RequiemUser user,RequiemUser authorizingUser)
	{
		return -1;
	}	
	
	@WebMethod
	public int removeUser(RequiemUser user,RequiemUser authorizingUser)
	{
		return RequiemModel.getInstance().removeUser(user, authorizingUser);
	}
//	===================================  Basis daten ==========================================	 
/*
 * 	usually we would use this, but since Webservice Generation often fails with 
 * java.lang.NullPointerException
	at com.sun.xml.internal.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1077)
	at com.sun.xml.internal.ws.model.RuntimeModeler.processRpcMethod(RuntimeModeler.java:1038)
	at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:615)
	at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:401)
	at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:240)	
 we delete the Exceptions 
 	
	@WebMethod
	public VorteilDB[] getVorteile(RequiemUser user)throws IllegalUserException
	{
		return RequiemModel.getInstance().getVorteile(user);
	}
	
	@WebMethod
	public int addVorteil(VorteilDB vorteilDB, RequiemUser user)throws IllegalUserException
	{
		return RequiemModel.getInstance().addVorteil(vorteilDB, user);
	}
	@WebMethod
	public int removeVorteil(VorteilDB vorteilDB, RequiemUser user)throws IllegalUserException
	{
		return RequiemModel.getInstance().removeVorteil(vorteilDB, user);
	}
*/
	@WebMethod
	public VorteilDB[] getVorteile(RequiemUser user)
	{
		return RequiemModel.getInstance().getVorteile(user);
	}
	
	@WebMethod
	public int addVorteil(VorteilDB vorteilDB, RequiemUser user)
	{
		return RequiemModel.getInstance().addVorteil(vorteilDB, user);
	}
	@WebMethod
	public int removeVorteil(VorteilDB vorteilDB, RequiemUser user)
	{
		return RequiemModel.getInstance().removeVorteil(vorteilDB, user);
	}
	@WebMethod
	public Bund[] getBuende(RequiemUser user)
	{
		return RequiemModel.getInstance().getBuende(user);
	}
	@WebMethod
	public int addBund(Bund bund, RequiemUser user)
	{
		return RequiemModel.getInstance().addBund(bund, user);
	}
	@WebMethod
	public int removeBund(Bund bund, RequiemUser user)
	{
		return RequiemModel.getInstance().removeBund(bund, user);
	}
	@WebMethod
	public Clan[] getClane(RequiemUser user)
	{
		return RequiemModel.getInstance().getClane(user);
	}
	@WebMethod
	public int addClan(Clan clan, RequiemUser user)
	{
		return RequiemModel.getInstance().addClan(clan, user);
	}
	@WebMethod
	public int removeClan(Clan clan, RequiemUser user)
	{
		return RequiemModel.getInstance().removeClan(clan, user);
	}
	@WebMethod
	public DisziplinDB[] getDisziplinen(RequiemUser user)
	{
		return RequiemModel.getInstance().getDisziplinen(user);
	}
	@WebMethod
	public int addDisziplin(DisziplinDB disziplinDB, RequiemUser user)
	{
		return RequiemModel.getInstance().addDisziplin(disziplinDB, user);
	}
	@WebMethod
	public int removeDisziplin(DisziplinDB disziplinDB, RequiemUser user)
	{
		return RequiemModel.getInstance().removeDisziplin(disziplinDB, user);
	}
	@WebMethod
	public Ritual[] getRituale(RequiemUser user)
	{
		return RequiemModel.getInstance().getRituale(user);
	}
	@WebMethod
	public int addRitual(Ritual ritual, RequiemUser user)
	{
		return RequiemModel.getInstance().addRitual(ritual, user);
	}
	@WebMethod
	public int removeRitual(Ritual ritual, RequiemUser user)
	{
		return RequiemModel.getInstance().removeRitual(ritual, user);
	}
	@WebMethod
	public JagdTechnik[] getJagdtechniken(RequiemUser user)
	{
		return RequiemModel.getInstance().getJagdtechniken(user);
	}
	@WebMethod
	public int addJagdTechnik(JagdTechnik jagdTechnik, RequiemUser user)
	{
		return RequiemModel.getInstance().addJagdTechnik(jagdTechnik, user);
	}
	
	@WebMethod
	public int removeJagdTechnik(JagdTechnik jagdTechnik, RequiemUser user)
	{
		return RequiemModel.getInstance().removeJagdTechnik(jagdTechnik, user);
	}
	//*/
}
